package kgc.qy.service.impl;

import kgc.qy.mapper.RoomMapper;
import kgc.qy.pojo.Room;
import kgc.qy.service.IRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl implements IRoomService {

    @Autowired
    private RoomMapper  roomMapper;

    @Override
    public List<Room> selectByName(String name,String dn,Integer statusId) {
        List<Room> rooms = roomMapper.selectByname(name,dn,statusId);
        return rooms;
    }

    @Override
    public int insertRoom(Room room) {
        int i = roomMapper.insertSelective(room);
        return i;
    }

    @Override
    public int deleteRoom(String name) {
        int i = roomMapper.deleteByRoom(name);
        return i;
    }
}
